#include <lvgl.h>
#include <SD.h>
#include <TJpg_Decoder.h>
#include "../../common.h"


extern const lv_img_dsc_t video_icon;
#define JPG_BUFFER_SIZE 60000
#define FRAME_LEN_BUFFER_SIZE 4

class Video
{
  private:
    uint8_t *display_buf;
    uint8_t *frame_len_buf_byte;
    uint32_t *frame_len_buf;
    size_t frame_len;
    File file_video;
    String video_list[100];
    int num_video=0;
    int no_video=0;
    lv_obj_t *scr=NULL, *label=NULL;
    lv_style_t font_style;
    void init_gui();

  public:
  Video();
  ~Video();
  Event main_process(Action);
};

